﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace GroupShop.Utility
{
    public static class HtmlHelperExt
    {
        public static MvcHtmlString PagerLink(this HtmlHelper htmlHelper, string className, string linkUrl, string linkText)
        {
            MvcHtmlString lnk;

            if (!string.IsNullOrEmpty(className))
            {
                lnk = MvcHtmlString.Create(string.Format("<li class=\"{0}\"><a href=\"{1}\">{2}</a></li>", className, linkUrl, linkText));
            }
            else
            {
                lnk = MvcHtmlString.Create(string.Format("<li><a href=\"{0}\">{1}</a></li>", linkUrl, linkText));
            }

            return lnk;
        }
    }
}
